package adm


type PkMode int8
type Ope int8
type State int8
type EventSignal bool

const (
	PkNone PkMode = iota
	PkAi
	PkNormal
)

const (
	OpeNone Ope = iota
	OpeCreate
	OpeUpdate
	OpeSelect
	OpeDelete
)

const (
	StateFail State = iota -1
	StateNothing
	StateUpdated
)

const (
	EventBreak = false
	EventContinue = true
)

func (s State) Success() bool {
	return s >= StateNothing
}

func (s State) Fail() bool {
	return s == StateFail
}

func (s State) Nothing() bool {
	return s == StateNothing
}

func (s State) Updated() bool {
	return s == StateUpdated
}


type ModelEvents struct {
}

func (this *ModelEvents) OnBind() {
}

func (this *ModelEvents) BeforeUpdate() EventSignal {
	return EventContinue
}

func (this *ModelEvents) BeforeCreate() EventSignal {
	return EventContinue
}

func (this *ModelEvents) BeforeSave() EventSignal {
	return EventContinue
}

func (this *ModelEvents) BeforeDestroy() EventSignal {
	return EventContinue
}

func (this *ModelEvents) AfterUpdate() {
}

func (this *ModelEvents) AfterCreate() {
}

func (this *ModelEvents) AfterSave() {
}

func (this *ModelEvents) AfterDestroy() {
}